package com.example.xViewChat.UI.Fragment;

import android.net.NetworkInfo;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.xViewChat.Bean.IntentBean;
import com.example.xViewChat.NettyClient.EventListener;
import com.example.xViewChat.NettyClient.EventListenerManager;

/**
 * Created by hasee on 2016-04-14.
 */
public abstract class EventListenerFragment extends Fragment implements EventListener {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        super.onCreateView(inflater,container,savedInstanceState);
        EventListenerManager.registerListener(this, getActivity());
        return null;
    }

    public void finish() {
        EventListenerManager.removeListener(this);
    }

    public void onRestart() {
        EventListenerManager.registerListener(this, getActivity());
    }

    @Override
    public void onStop(){

        EventListenerManager.removeListener(this);
        super.onStop();
    }

    @Override
    public void onMessageReceived(IntentBean intentBean) {

    }

    @Override
    public void onReplyReceived(IntentBean intentBean) {

    }

    @Override
    public void onNetworkChanged(NetworkInfo networkinfo) {

    }

    @Override
    public void onConnectionStatus(boolean isConnected) {

    }

    @Override
    public void onConnectionSucceed() {

    }

    @Override
    public void onConnectionClosed() {

    }

    @Override
    public void onReLogin() {

    }

    @Override
    public void onLoginSuccess() {

    }

    @Override
    public void onLoginFailed() {

    }
}
